package com.springboot.framework.dao.mapper;

import com.springboot.framework.dao.entity.Coupons;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
import tk.mybatis.mapper.common.Mapper;

public interface CouponsMapper extends Mapper<Coupons> {

//    @Update("update coupons set coupons_stock = coupons_stock - 1 where coupons_id = #{couponsId} and coupons_stock >= 1")
    @Update("update coupons set coupons_stock = coupons_stock - 1 where coupons_id = #{couponsId}")
    void decreaseStock(@Param("couponsId") Integer couponsId);
}